Here is a simple data set that is put into an R Data Frame and then plotted using R's ggplot2 library:
In [1]:
year <- c(2000 , 2001 , 2002 , 2003 , 2004)
rate <- c(9.34 , 8.50 , 7.62 , 6.93 , 6.60)
df = data.frame(year, rate)
In [2]:
head(df)
Out[2]:
In [3]:
library(ggplot2)
In [4]:
ggplot(df, aes(x=year, y=rate)) +
geom_point(shape=1) + # Use hollow circles
geom_smooth(method=lm) # Add linear regression line, with 95% confidence region
Out[4]:
In [5]:
head(iris)
Out[5]:
In [6]:
pairs(iris[1:4], main = "Iris Data", pch = 21,
bg = c("red", "green3", "blue")[unclass(iris$Species)])
In [ ]: